home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1625 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: senator-bedfellow.mit.edu!red-branch!rid
  2. From: rid@red-branch.MIT.EDU (Shawna Grimm)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Must I free my linked lists? (GCC)
  5. Date: 22 Jan 1996 02:28:57 GMT
  6. Organization: Massachvsetts Institvte of Technology
  7. Message-ID: <4dusp9$7k3@senator-bedfellow.MIT.EDU>
  8. References: <4dudic$aif@vixen.cso.uiuc.edu>
  9. NNTP-Posting-Host: red-branch.mit.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Unknown (Dannyman@uiuc.edu) typed in the following on 21 Jan 1996 22:09:16 GMT:
  13. :    I'm writing a program that makes use of dynamic memory allocation through
  14. : linked lists using malloc() ... from an implementation PoV there's no need
  15. : to flush this stuff as after the queue is created it's output and the
  16. : program exits. My question is;
  17.  
  18. :    "When my program exits, is the dynamic memory in the queues returned to
  19. : the system or is a "memory hole" left, so that I should actually go back and
  20. : return all the memory in my program ..."
  21.  
  22. Yes, you _should_ free any memory that you allocate in your program. 
  23. Memory that is allocated and not freed will not be returned to the system 
  24. unless you turn the machine off, so if you want your memory back, you 
  25. must free it. Personally, I would prefer to use AllocMem() or AllocVec()
  26. (with FreeMem() and FreeVec() ofcourse).
  27.  
  28. :    Thanks. Please reply publically, because I got 20 emails on my last
  29. : question. No *need* for all you courteous folk to respond! :)
  30.  
  31. : -- 
  32. : =====///====================================================================
  33. : ====///=======This message brought to you by dannyman@uiuc.edu==============
  34. : \\\///=========HOME PAGE! http://www.uiuc.edu/ph/www/djhoward ==============
  35. : =\XX/A1200==================================================================
  36. :                   "Our ship is broken. Can you make it go?"
  37.  
  38.  
  39. * Lars M. Hansen              
  40.